package task3_3;

public  class Bouquet {
	private int price;
    private int numberofflowers;
    private int count=0;
    private Flowers[] flowers;
	
    public double getPrice() {
        return price;
    }
        
    public int getNumberofflowers() {
		return numberofflowers;
	}
    
    public Flowers[] getFlowers() {
		return flowers;
	}
    
    public int getCount() {
		return count;
	}
    public Bouquet(int numberofflowers){	
    	this.numberofflowers=numberofflowers;
    	this.flowers=new Flowers[numberofflowers];
    	this.price=0;	
    	this.count=0;
    }	

	

	public Bouquet addFlower(Flowers flower) {        
        if (count<this.numberofflowers) this.flowers[count] = flower;
        count++;
        return this;
        
    }
	
	public int BouquetPrice() {
		for (int i=0;i<this.flowers.length;i++) {
			this.price += this.flowers[i].price;			
		}		
		return this.price;		
	}
	public void PrintBouquet()
	{
		System.out.println("Bouquet:");
		for (int i=0;i<this.flowers.length;i++)
		{
			System.out.printf("%s %s %d \n" ,this.flowers[i].name,this.flowers[i].color,this.flowers[i].price);
			
			
		}
		
	}
}
